<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.div_mod{
				width: 100px;
				height: 100px;
				border: 1px solid blue;
				float: left;
				margin: 50px;
			}
			.div_mod3{
				width: 100px;
				height: auto;
				border: 1px solid red;
				margin: 50px;
				float: left;
			}
		</style>
	</head>
	<body>
		<div id="div1" class="div_mod"></div>
		<div id="div2" class="div_mod"></div>
		<div id="div3" class="div_mod3">
			<h3>h3标签</h3>
			<p class="p_class" id="p_id">p1</p>
			<p>p2</p>
			<p>p3</p>
			<p>p4</p>
			<p>p5</p>
			<select name="select1">
				<option value="option1" class="option_class" id="option_id">op1</option>
			</select>
		</div>
		
		<img src="./img/ygg.jpg" id="img_id" class="img_class" >
	</body>
	<script type="text/javascript">
		//div-class查询
		var div1_class1= document.getElementsByClassName('div_mod')
		var div2_class2= document.getElementsByClassName('div_mod3')
		console.log(div1_class1)
		console.log(div2_class2)
		//div-id查询
		var div1_id = document.getElementById('div1')
		var div2_id = document.getElementById('div2')
		var div3_id = document.getElementById('div3')
		console.log(div1_id)
		console.log(div2_id)
		console.log(div3_id)
		//div-tag查询
		var div_obj = document.getElementsByTagName('div')
		console.log(div_obj)
		//p-tag、class、id查询
		var p_obj = document.getElementsByTagName('p')
		var p_class = document.getElementsByClassName('p_class')
		var p_id = document.getElementById('p_id')
		console.log(p_obj)
		console.log(p_class)
		console.log(p_id)
		//img-tag、class、id查询
		var img_obj = document.getElementsByTagName('img')
		var img_class = document.getElementsByClassName('img_class')
		var img_id = document.getElementById('img_id')
		console.log(img_obj)
		console.log(img_class)
		console.log(img_id)
		//option-tag、class、id查询
		var option_obj = document.getElementsByTagName('option')
		var option_class = document.getElementsByClassName('option_class')
		var option_id = document.getElementById('option_id')
		console.log(option_obj)
		console.log(option_class)
		console.log(option_id)
	</script>
</html>
